<!-- 头部部分 -->
<style>
    .main-active {
        background: linear-gradient(0deg, rgba(215, 0, 15, 1), rgba(236, 67, 67, 1));
        /* 一下为兼容ie9渐变 */
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eb3f40', endColorstr='#db0e1a', GradientType=0);
        box-shadow: 0px 0px 5px 0px rgba(110, 1, 9, 0.6);
        font-size: 16px;
        font-family: SourceHanSansSC;
        font-weight: 400;
        color: white;
        position: relative;
        z-index: 88;
    }
</style>

<header>
    <div class="headers">
        <div class="header-top">
            <div class="header-top-right">
                <div class="input-serch">
                <form>
                    <input name="key" class="search" placeholder="搜索...">
                    <img class="serch-go" src="../static/images/search.png" alt="">
                </form>
                </div>
                <!-- 没有登录的状态 -->
                <div class="nologin" >
                    <a class="login" href="page_login.html">登录</a>
                    <a class="register" href="page_register.html">注册</a>
                </div>
                
                <!-- 登录后的状态 -->
                <div class="oklogin" style="display: none;">
                    <span class="txt">我是用户名</span>
                    <a class="login" href="page_login.html">登出</a>
                </div>
            </div>
        </div>
    </div>
    <!-- header中间的选项切换部分 -->
    <div class="header-content">
        <div class="headers-content">
            <div class="logo">
                <img src="../static/images/header/logo.png" alt="">
            </div>
            <ul class="list-nav">
                <li><a href="index.html">首页</a> <span></span></li>
                <li><a href="page_dh-introduce.html">龙现东海</a><span></span> </li>
                <li><a href="list_college-knowledge.html">期货学院</a> <span></span></li>
                <li><a href="list_Investor-transaction.html">未来投资家</a> <span></span></li>
                <li><a href="list_curriculum-gl.html">网络课程</a><span></span> </li>
                <li><a href="list_zj_space.html">投资者之家</a><span></span> </li>
                <li><a href="page_exhibition-video.html">教育展示</a><span></span> </li>
                <li><a href="list_tj-notice.html">投教动态</a><span></span> </li>
                <li><a class="last-a" href="list_union.html">投教基地联盟</a> </li>
            </ul>
        </div>

    </div>
</header>

<script>

    $(document).ready(function () {
        $(".list-nav li>a").each(function (v, i) {
            $this = $(this);

            //    添加选中效果判断当前的字段是否有这个字段url

            if ($this[0].href.indexOf("index") == String(window.location.href.indexOf("index"))) {
                if (v == 0) {
                    $(this).addClass("main-active");
                }

            }

            if ($this[0].href.indexOf("_dh") == String(window.location.href.indexOf("_dh"))) {
                if (v == 1) {
                    $(this).addClass("main-active");
                }

            }
            if ($this[0].href.indexOf("_college") == String(window.location.href.indexOf("_college"))) {
                if (v == 2) {
                    $(this).addClass("main-active");
                }
            }

            if ($this[0].href.indexOf("_Investor") == String(window.location.href.indexOf("_Investor"))) {
                if (v == 3) {
                    $(this).addClass("main-active");
                }

            }

            if ($this[0].href.indexOf("_curriculum") == String(window.location.href.indexOf("_curriculum"))) {
                if (v == 4) {
                    $(this).addClass("main-active");
                }

            }

            if ($this[0].href.indexOf("_zj") == String(window.location.href.indexOf("_zj"))) {
                if (v == 5) {
                    $(this).addClass("main-active");
                }

            }
            if ($this[0].href.indexOf("_exhibition") == String(window.location.href.indexOf("_exhibition"))) {
                if (v == 6) {
                    $(this).addClass("main-active");
                }

            }
            if ($this[0].href.indexOf("_tj") == String(window.location.href.indexOf("_tj"))) {
                if (v == 7) {
                    $(this).addClass("main-active");
                }

            }
            if ($this[0].href.indexOf("_union") == String(window.location.href.indexOf("_union"))) {
                if (v == 8) {
                    $(this).addClass("main-active");
                }

            }


            // 详情页面的indexof判断

            if ($this[0].href.indexOf("_dh") == String(window.location.href.indexOf("_dh") - 2)) {
                if (v == 1) {
                    $(this).addClass("main-active");
                }
            }
            if ($this[0].href.indexOf("_college") == String(window.location.href.indexOf("_college") - 2)) {
                if (v == 2) {
                    $(this).addClass("main-active");
                }
            }
            if ($this[0].href.indexOf("_Investor") == String(window.location.href.indexOf("_Investor") - 2)) {
                if (v == 3) {
                    $(this).addClass("main-active");
                }
            }
            if ($this[0].href.indexOf("_curriculum") == String(window.location.href.indexOf("_curriculum") - 2)) {
                if (v == 4) {
                    $(this).addClass("main-active");
                }
            }
            if ($this[0].href.indexOf("_exhibition") == String(window.location.href.indexOf("_exhibition") - 2)) {
                if (v == 6) {
                    $(this).addClass("main-active");
                }
            }

            if ($this[0].href.indexOf("_tj") == String(window.location.href.indexOf("_tj") - 2)) {
                if (v == 7) {
                    $(this).addClass("main-active");
                }
            }


        });

    });


    //   切割cookie
    var cookieTxts = document.cookie.split(';')[0].split('=')[1]
    //   var cookieTxt = document.cookie.
    var htmltxt
    if ($('.wz-span').children("a:last-child")[0] != undefined) {
        htmltxt = $('.wz-span').children("a:last-child")[0].innerText
        //   设置cookie
        document.cookie = "txt=" + htmltxt;
    }


    if ($('.wz-spans').children("a:last-child")[0] != undefined) {
        var detailTxt = $('.wz-spans').children("a:last-child")
        detailTxt[0].innerText = cookieTxts

    }




    // 搜索跳转
    $('.serch-go').click(function () {
        window.location.href = 'list_search.html'
    })
    window.onunload = function(){
        $('.search').val('')
    }





</script>